﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace f1
{
    public partial class Form_delete : Form
    {
        int delNum;
        public Form_delete()
        {
            InitializeComponent();
        }

        private void tb_delNum_TextChanged(object sender, EventArgs e)
        {
            this.delNum = Convert.ToInt32(tb_delNum.Text);
        }

        private void btn_del_Click(object sender, EventArgs e)
        {
            try
            {
                if (OrderService.deleteOrder(delNum))
                {
                    DialogResult result = MessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Close();
                }
                else
                {
                    DialogResult result = MessageBox.Show("删除失败1", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch
            {
                DialogResult result = MessageBox.Show("删除失败2", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            
        }
    }
}
